<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../vue.js"></script>
</head>
<body>
    <div id="app">
        <p>{{a}}</p>
        <p>{{b}}</p>

        <!-- 当点击加法时，改变的只有B，整体节点不会更新 -->
        <button @click="b++">加1</button>
    </div>
    <script>
        //vue的生成的虚拟dom和旧虚拟dom比较，只会修改发生改变的节点
        Vue.config.productionTip = false;
        const vm = new Vue({
            el:'#app',
            data(){
                return{
                    a:1,
                    b:5
                }
            }
        })
    </script>
</body>
</html>